package com.example.busshop.entity;

import com.example.busshop.common.entity.LogicEntity;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.util.Set;

@Entity
@Setter
@Getter
//@Table(name = "line_item")
@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"},ignoreUnknown = true)

public class LineItem extends LogicEntity {

    @ManyToOne(fetch = FetchType.LAZY)
    private Order order;
    @OneToOne(fetch = FetchType.LAZY,
    orphanRemoval = true,
            cascade = CascadeType.ALL)
//    @JsonIgnore
    private Item item;
    @Column
    double quantity;

}
